﻿using ControleRepresentante.Data.Catalogs;
using ControleRepresentante.Data.Helpers;

namespace ControleRepresentante.Data.CatalogSteps
{
    internal class CreateContatoTableCatalogStep : CatalogStepBase<ControleRepresentanteCatalogStepTypes>
    {
        protected override ControleRepresentanteCatalogStepTypes CatalogStepType
        {
            get { return ControleRepresentanteCatalogStepTypes.CreateContato; }
        }

        public override void Execute(IDataAccess dataAccess)
        {
            new CatalogStepHelper(dataAccess)
                .CreateTable("Contato")
                    .AddColumn("DetailsHolderId", ColumnType.Guid, false, false)
                    .AddForeignKey("DetailsHolderId", "DetailsHolder", "AttributeHolderId")
                    .AddColumn("Tipo", ColumnType.ShortNumeric, false, false)
                    .AddColumn("Valor", ColumnType.ShortString, false, false)
                    .AddColumn("Principal", ColumnType.Boolean, false, false)
                    .AddColumn("Observacao", ColumnType.LongText, true, false);
        }
    }
}